package com.example.peibei.ui.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dingtao.common.bean.HomeBannerCate;
import com.dingtao.common.bean.WeekTimeBean;
import com.example.peibei.R;

import java.util.List;

public class WeekTimeAdapter extends BaseQuickAdapter<WeekTimeBean, BaseViewHolder> {
    public WeekTimeAdapter(@Nullable List<WeekTimeBean> data) {
        super(R.layout.item_week_time, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, WeekTimeBean item) {
        helper.setText(R.id.rb_week, item.getWeekName()).setText(R.id.tv_start_time, item.getStartTime()).setText(R.id.tv_end_time, item.getEndTime());
        LinearLayout ll_week_time = helper.getView(R.id.ll_week_time);
        LinearLayout ll_week_time_no = helper.getView(R.id.ll_week_time_no);
        if (item.getStartTime().equals("") || item.getEndTime().equals("")) {
            ll_week_time.setVisibility(View.GONE);
            ll_week_time_no.setVisibility(View.VISIBLE);
        } else {
            ll_week_time.setVisibility(View.VISIBLE);
            ll_week_time_no.setVisibility(View.GONE);
        }
    }
}
